package com.joinlabs.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.joinlabs.entity.Ordersessionid;
import com.joinlabs.mapper.OrdersessionidMapper;
import com.joinlabs.service.IOrderService;
import com.joinlabs.service.IOrderSessionService;
@Service
public class JsessionServiceImpl implements IOrderSessionService {
	
	
	@Resource(name = "ordersessionidMapper")
	private OrdersessionidMapper osmap;
	@Override
	public void updataJsessionId(String oid, String jid) {
		Ordersessionid jsId = new Ordersessionid();
		jsId.setjSession(jid);
		jsId.setOrderId(oid);
		if(osmap.selectByPrimaryKey(oid) == null) {
			osmap.insert(jsId);
		}
		else {
			osmap.updateByPrimaryKey(jsId);
		}
	}

	@Override
	public String getJSessionId(String oid) {
		Ordersessionid jsId = osmap.selectByPrimaryKey(oid);
		
		return jsId.getjSession();
	}

	
}
